﻿using System.Diagnostics;

namespace DimensionsHelper.LanguageService.Syntax;

public class MetadataDefaultAnswer : MetadataSingleArgumentSuffix<Expression>
{
    internal MetadataDefaultAnswer(SyntaxToken defaultAnswerKeywordToken, SyntaxNode? parent) :
        base(SyntaxKinds.MetadataDefaultAnswer,
            defaultAnswerKeywordToken,
            NodeConverter.ToIdentifier(defaultAnswerKeywordToken),
            parent)
    {
    }
}

public static partial class NodeFactory
{
    public static MetadataDefaultAnswer CreateMetadataDefaultAnswer(SyntaxNode? parent,
        SyntaxToken defaultAnswerKeywordToken, Expression? value)
    {
        Debug.Assert(defaultAnswerKeywordToken.IsNode(SyntaxKinds.DefaultAnswerKeywordToken));
        MetadataDefaultAnswer defaultAnswer = new(defaultAnswerKeywordToken, parent);
        return UpdateMetadataSingleArgumentSuffix(defaultAnswer, value);
    }
}